<%@ page language="java" contentType="text/html; utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>找回密码/重置密码</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="keywords" content="fly,layui,前端社区">
  <meta name="description" content="Fly社区是模块化前端UI框架Layui的官网社区，致力于为web开发提供强劲动力">
  <link rel="stylesheet" href="/fly-3.0/res/layui/css/layui.css">
  <link rel="stylesheet" href="/fly-3.0/res/css/global.css">
</head>
<body>

<%@ include file="../common/header.jsp"%>

<div class="layui-container fly-marginTop">
  <div class="fly-panel fly-panel-user" pad20>
    <div class="layui-tab layui-tab-brief" lay-filter="user">
      <ul class="layui-tab-title">
        <li><a href="/user/login/">登入</a></li>
        <c:if test="${empty forget}">
            <li class="layui-this">找回密码</li>
        </c:if>
        <c:if test="${!empty forget}">
            <li class="layui-this">重置密码</li>
        </c:if>
      </ul>
      <div class="layui-form layui-tab-content" id="LAY_ucm" style="padding: 20px 0;">
        <div class="layui-tab-item layui-show">
            <c:if test="${!empty forget}">
                <div class="fly-msg">${forget.userName}，请重置您的密码</div>
                <c:if test="${!empty sessionScope.token}">
                    <div class="layui-form layui-form-pane"  style="margin-top: 30px;">
                        <form action="/visitor/repass" method="post">
                            <input type="hidden" name="userId" value="${forget.userId}"/>
                            <input type="hidden" name="token" value="${token}"/>
                            <div class="layui-form-item">
                                <label for="L_pass" class="layui-form-label">密码</label>
                                <div class="layui-input-inline">
                                    <input type="password" id="L_pass" name="pass" required lay-verify="required" autocomplete="off" class="layui-input">
                                </div>
                                <div class="layui-form-mid layui-word-aux">6到16个字符</div>
                            </div>
                            <div class="layui-form-item">
                                <label for="L_repass" class="layui-form-label">确认密码</label>
                                <div class="layui-input-inline">
                                    <input type="password" id="L_repass" name="repass" required lay-verify="required" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label for="L_vercode" class="layui-form-label">人类验证</label>
                                <div class="layui-input-inline">
                                    <input type="text" id="L_vercode" name="vercode" required lay-verify="required" placeholder="请回答后面的问题" autocomplete="off" class="layui-input">
                                </div>
                                <div class="layui-form-mid">
                                        <%--<span style="color: #c00;">{{d.vercode}}</span>--%>
                                    <img id="checkCodeImg" src="/changeImg" onclick="getNewImg()"/>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <input type="hidden" name="userName" value="${forget.userName}">
                                <input type="hidden" name="userMail" value="${forget.userMail}">
                                <button class="layui-btn" alert="1" lay-filter="*" lay-submit>提交</button>
                            </div>
                        </form>
                    </div>
                </c:if>
                <c:if test="${empty sessionScope.token}">
                    <div class="fly-error">该重置密码链接已失效，请重新校验您的信息</div>
                    <div class="fly-error">非法链接，请重新校验您的信息</div>
                </c:if>
            </c:if>


          <c:if test="${empty forget}">
              <div class="layui-form layui-form-pane">
                  <form method="post">
                      <div class="layui-form-item">
                          <label for="L_email" class="layui-form-label">邮箱</label>
                          <div class="layui-input-inline">
                              <input type="text" id="L_email" name="email" required lay-verify="required" autocomplete="off" class="layui-input">
                          </div>
                      </div>
                      <div class="layui-form-item">
                          <label for="L_vercode" class="layui-form-label">人类验证</label>
                          <div class="layui-input-inline">
                              <input type="text" id="L_vercode" name="vercode" required lay-verify="required" placeholder="请回答后面的问题" autocomplete="off" class="layui-input">
                          </div>
                          <div class="layui-form-mid">
                              <img id="checkCodeImg" src="/changeImg" onclick="getNewImg()"/>
                          </div>
                      </div>
                      <div class="layui-form-item">
                          <button class="layui-btn" alert="1" lay-filter="*" lay-submit>提交</button>
                      </div>
                  </form>
              </div>
          </c:if>
        </div>
      </div>
    </div>
  </div>

  
</div>

<%@ include file="../common/footer.jsp"%>

</body>
</html>